-- ------------------------------------------------------------------------
-- > lumDrops (Kreoss @ Quel'Thalas EU) <
-- ------------------------------------------------------------------------
-- Credits: zork, Lyn.
-- ------------------------------------------------------------------------

-- ------------------------------------------------------------------------
-- > 0. Configuration and Media
-- ------------------------------------------------------------------------

	-- Media
	local background = "Interface\\AddOns\\lumDrops\\media\\background"
	local border = "Interface\\AddOns\\lumDrops\\media\\border"

-- ------------------------------------------------------------------------
-- > 1. Variables
-- ------------------------------------------------------------------------

	local bgColor = {r = 0, g = 0, b = 0, a = 0.8} -- Frame Background Color
	local cbColor = RAID_CLASS_COLORS[select(2, UnitClass("player"))] -- Class Colored border
	local dbColor = {r = 0.15, g = 0.15, b = 0.15, a = 1} -- Default border color if not Class Colored
	local Drops = {}
	
-- ------------------------------------------------------------------------
-- > 2. Functions
-- ------------------------------------------------------------------------

	-- Create Panel
	function Drops:CreatePanel(classColored, fname, fparent, fstrata, flevel, fwidth, fheight, fcolor, fpoints, ftexture, fborder, ftilesize, fedgesize, finsect)
		local f = CreateFrame("Frame","Drop_"..fname,UIParent)
		if classColored then bColor = cbColor else bColor = dbColor end
		f:SetParent(fparent)
		f:SetFrameStrata(fstrata)
		f:SetFrameLevel(flevel)
		f:SetWidth(fwidth)
		f:SetHeight(fheight)
		f:SetBackdrop({bgFile = ftexture, edgeFile = fborder, tile = false, tileSize = ftilesize, edgeSize = fedgesize, insets = {left = finsect, right = finsect, top = finsect, bottom = finsect}})
		f:SetBackdropColor(fcolor.r, fcolor.g, fcolor.b, fcolor.a)
		f:SetBackdropBorderColor(bColor.r, bColor.g, bColor.b, bColor.a)
		for i,v in pairs(fpoints) do
			f:SetPoint(unpack(v))
		end
	end

-- ------------------------------------------------------------------------
-- > 3. Calls
-- ------------------------------------------------------------------------

	Drops:CreatePanel(true, "BottomPanel", "UIParent", "BACKGROUND", 0, 430, 24, bgColor, {{"BOTTOM", UIParent, "BOTTOM", 0, -4}}, background, border, 32, 12, 0) -- Bottom Panel
	Drops:CreatePanel(true, "MinimapPanel", "Minimap", "BACKGROUND", 0, Minimap:GetWidth()+10, Minimap:GetHeight()+10, bgColor, {{"TOPLEFT", Minimap, "TOPLEFT", -5,5}}, background, border, 32, 12, 0) -- Minimap Panel